#include "SquareObstacleFactory.h"
#include "FactoryUtil.h"

SquareObstacleFactory::SquareObstacleFactory(void)
{
}

SquareObstacleFactory::~SquareObstacleFactory(void)
{
}

Element* SquareObstacleFactory::createElement( XMLElement* element)
{
	return this->createSquareObstacle(element);
}

CuadrangularObstacle * SquareObstacleFactory::createSquareObstacle( XMLElement* obstacleElement)
{
	CuadrangularObstacle* obstacle = new CuadrangularObstacle();

	string id = FactoryUtil::getInstance()->buildId(obstacleElement);
	Position *position = FactoryUtil::getInstance()->buildPosition(obstacleElement);
	float base = FactoryUtil::getInstance()->buildBase(obstacleElement);
	float altura = FactoryUtil::getInstance()->buildAltura(obstacleElement);

	obstacle->setId(id);
	obstacle->setPosition(position);
	obstacle->setBase(base);
	obstacle->setAltura(altura);
	obstacle->setElementColor(FactoryUtil::getInstance()->buildFrogBackgroundColor(obstacleElement));
	obstacle->setLineColor(FactoryUtil::getInstance()->buildFrogLineColor(obstacleElement));
	obstacle->setTexture(FactoryUtil::getInstance()->buildTexture(obstacleElement));

	return obstacle;
}